import React from 'react';
import { useNavigate, Outlet, useLocation } from 'react-router-dom'


import { Layout, Menu } from 'antd';
var { Content, Sider } = Layout
function Staff(props) {

    var navigate = useNavigate()
    var location = useLocation()

    const items = [
        { label: '员工管理', key: '/index/staff/staffManage' }, // 菜单项务必填写 key
        { label: '角色权限管理', key: '/index/staff/roleManage' }, // 菜单项务必填写 key
    ];
    return (
        <Layout className='staff'>
            <Sider>
                <div className="title">员工</div>
                <Menu
                    mode="inline"
                    onClick={({ key }) => { navigate(key) }}
                    items={items}
                    defaultSelectedKeys={[location.pathname]}>
                </Menu>
            </Sider>
            <Content>
                {/* 三级路由出口 */}
                <Outlet></Outlet>
            </Content>
        </Layout>
    );
}

export default Staff;